/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Business.Launcher.Admin;

import Business.RecordsOperation.RecordsOperation;
import UserInterface.AddRegions.AddRegionsJFrame;
import UserInterface.Result.ResultJFrame;
import UserInterface.Admin.AdminJFrame;
import UserInterface.Analysis.AnalysisJFrame;

/**
 *
 * @author hooting
 */
public class LaunchAdmin {

	
	private static AdminJFrame adminJFrame = null;
	
    public static void showResultJFrame(){
	    ResultJFrame jframe = new ResultJFrame();
	   	String[] titles = new RecordsOperation().getReportTitles();
	    jframe.setTitles(titles);
	    jframe.showDescription();
	    jframe.setVisible(true);
    }

    public static void showAnalysisFrame(String type){
	   new AnalysisJFrame(type).setVisible(true); 
    }
	
	public static void showAdminJFrame(){
		if(adminJFrame == null){
			adminJFrame = new AdminJFrame();
		}
		adminJFrame.setVisible(true);
	}

	public static void showAddRegionJframe(){
		new AddRegionsJFrame().setVisible(true);
	}

	public static void dispose(){
		adminJFrame.dispose();
		adminJFrame = null;
	}
}
